package chapter1021;

class Student1 {
    String name;
    String gender;
    int age;
    int id;
    double score;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", score=" + score +
                '}';
    }
}

class Student2 {
    private String name;
    private String gender;
    private int age;
    private int id;
    private double score;

    public void info(){
        System.out.println(  "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", score=" + score +
                '}'
        );
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", score=" + score +
                '}';
    }
}

class Student3 {
    private String name;
    private String gender;
    private int age;
    private int id;
    private double score;

    public Student3() {
        name = "N";
        gender = "?";
        age = 10;
        id = 123;
        score = -1;
    }

    public Student3(String name, String gender, int age, int id, double score) {
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.id = id;
        this.score = score;
    }

    public void info(){
        System.out.println(  "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", score=" + score +
                '}'
        );
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", score=" + score +
                '}';
    }
}

class TestStudent {
    public static void main(String[] args) {
        Student1 student1 = new Student1();
        student1.name = "John";
        student1.gender = "Male";
        student1.age = 25;
        student1.id = 123;
        student1.score = 3.14;
        System.out.println(student1);

        Student2 student2 = new Student2();
        student2.setName("John");
        student2.setGender("Female");
        student2.setAge(25);
        student2.setId(123);
        student2.setScore(3.14);
        student2.info();
        System.out.println(student2.getName() + student2.getGender() + student2.getAge() + student2.getScore());

        Student3 student3 = new Student3();
        System.out.println(student3);

        Student3 student4 = new Student3("Lain","Female",19,23131003,5);
        System.out.println(student3);
    }
}
